/**
 * 
 */
package sn.gandal.mobile.kalpet;

import sn.gandal.mobile.kalpet.adaptators.TextViewAdapter;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

/**
 * @author SOWDIOMYERO
 *
 */
public class KAccueilMenuActivity extends Activity {

	GridView gridView;
	 
	
	 @Override
	    public void onCreate(Bundle savedInstanceState) {
	        super.onCreate(savedInstanceState);
	        setContentView(R.layout.menu_accueil);
	        
	        gridView=(GridView)findViewById(R.id.tabMenuAccueil);
	        //ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
				//	android.R.layout.simple_list_item_1, numbers);
	        
			gridView.setAdapter(new TextViewAdapter(getApplicationContext()));
			gridView.setOnItemClickListener(new OnItemClickListener() {
				@Override
				public void onItemClick(AdapterView<?> parent, View v,
					int position, long id) {
				  /* Toast.makeText(getApplicationContext(),
					((TextView) v).getText(), Toast.LENGTH_SHORT).show();
				   */
					Intent intent;
					if(! isUserAuthenticated()){
					 intent= new Intent(getApplicationContext(), Kauthentication.class);
					}else{
					 intent=null;	
					}
					
					startActivity(intent);
					
				}
				
			});
		 }
	 
	 public boolean isUserAuthenticated(){
		return false;
		 
	 }
}
